<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt"  prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>OA协同办公系统</title>
<link href="css/table.css" rel="stylesheet" type="text/css" />
<style type="text/css">
tr,td{background: #ffffff}
</style>
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/file.js"></script>
<script type="text/javascript">
function loadFile(val){
		var fileId=$("#fileArray").val();
		if(fileId!=''&&fileId!='null'){
			var param={"fileArray":fileId};
			$.post("getFileList.action",param,function(data) {
				var list=data.fileList;
				for(var i=0;i<list.length;i++){
					$("#"+val).prepend("<li>"+list[i].name+"&nbsp;<a href=\"downLoadFile.action?fileId="+list[i].id+"\">下载</a></li>");
		        }
			},"json");
		}
	}
	window.onload=function(){
		loadFile('filetable');
	}

function opinionReoly(){
	var reportid = $("#reportId").val();
	var param={"reportId":reportid};
	$.post("opinionReoly.action",param,function(data){
		var list = data.opinionList;
		if(list.length>0){
		var info="<table width=\"100%\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bordercolor=\"#999999\" bgcolor=\"#999999\" ><tr><td class=\"bgcolor5\" align=\"center\" height=\"17px\" >批示意见</td></tr>";
		for(var i=0; i < list.length; i++){
			info+="<tr><td align=\"left\">"+list[i].content;
			info+="<div align=\"right\"><br/>"+list[i].userName+"&nbsp;"+(list[i].addTime.year-100+2000)+"-"+(list[i].addTime.month+1)+"-"+(list[i].addTime.date)+"</div></td></tr>";
		}
		info+="</table>";
		$("#opinion").html(info);
		}
	},"json");
}
window.onload = function(){
	loadFile('filetable');
	opinionReoly();
}
</script>
</head>
<body>
<input type="hidden" id="fileArray" value="${oMyReports.fileId}">
<table align="center" border="0" cellpadding="0" cellspacing="0" width="98%">
  <tbody>
  <tr>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
    <td style="background: url('image/wsoa_window_002.gif');"><table border="0" cellpadding="0" cellspacing="0">
      <tbody><tr>
        <td align="center" style="background: url('image/wsoa_window_002.gif');" width="10"><img src="image/center_19.gif"></td>
        <td align="center" style="background: url('image/wsoa_window_002.gif');"></td>
        <td></td>
        </tr>
    </tbody>
    </table></td>
    <td style="background: url('image/wsoa_window_002.gif');" width="1"></td>
  </tr>
  <tr>
    <td style="background: url('image/wsoa_window_010.gif');"  width="1">&nbsp;</td>
    <td>
    <input id="reportId" type="hidden" value="${oMyReports.id }" />
	<table class="table5" style="width:100%;margin: 10px 0px 10px 0px;height: 400px" align="center">
		<tr>
			<td width="80px" class="table5 bgcolor5 tdtytie">汇报日期：</td>
			<td class="table5" width="200px"><fmt:formatDate value="${oMyReports.reportingDate}" type="date"/></td>
			<td class="table5 bgcolor5 tdtytie" width="50px">类型：</td>
			<td class="table5" width="100px">${oMyReports.type }</td>
			<td class="table5 bgcolor5 tdtytie" width="50px">模版：</td>
			<td class="table5" width="100px">${oMyReports.templateName }</td>
		</tr>
		<tr>
			<td class="table5 bgcolor5 tdtytie">提交：</td><td class="table5"  colspan="5">${names}</td>
		</tr>
		<tr><td class="table5 bgcolor5 tdtytie">附件：</td><td class="table5" colspan="5">
			<ul class="ulxz" id="filetable">
                
            </ul>
		</td></tr>
		<tr>
			<td class="table5 bgcolor5 tdtytie">汇报内容：</td><td class="table5" colspan="5">${oMyReports.content }</td>
		</tr>
		<tr>
			<td class="table5 bgcolor5 tdtytie">备注：</td><td class="table5" colspan="5">${oMyReports.note }</td>
		</tr>
		<tr>
			<td class="table5 bgcolor5 tdtytie">批示意见：</td><td id="opinion" class="table5" colspan="5">&nbsp;</td>
		</tr>
		<tr><td class="table5" align="center" colspan="6"><input class="button_02" type="button" value="退出" onclick="window.close();"/></td></tr>
	</table>
	
     </td>
<td style="background: url('image/wsoa_window_006.gif');"  width="1">&nbsp;</td></tr>
  <tr>
    <td height="1" width="1"><img src="image/wsoa_window_009.gif" height="16" width="14"></td>
    <td style="background: url('image/wsoa_window_008.gif');" height="1"></td>
    <td height="1" width="1"><img src="image/wsoa_window_007.gif" height="16" width="12"></td>
  </tr>
</tbody>
</table>
</body>
</html>